import request from "@/utils/request";

export const getCategoriesAllApi = () => {
  return request({
    method: "GET",
    url: "/private/v1/categories",
  });
};

export const getAttributesInfoApi = (id, params) => {
  return request({
    method: "GET",
    url: `private/v1/categories/${id}/attributes`,
    params,
  });
};

export const addManyCategoriesApi = (id, data) => {
  return request({
    method: "POST",
    url: `private/v1/categories/${id}/attributes`,
    data,
  });
};

export const getManyCategoriesApi = (id, cId, params) => {
  return request({
    method: "GET",
    url: `private/v1/categories/${id}/attributes/${cId}`,
    params,
  });
};
export const editManyCategoriesApi = (id, cId, data) => {
  return request({
    method: "PUT",
    url: `private/v1/categories/${id}/attributes/${cId}`,
    data,
  });
};

export const delManyCategoriesApi = (id, cId) => {
  return request({
    method: "DELETE",
    url: `private/v1/categories/${id}/attributes/${cId}`,
  });
};
